# Contributor: Gennady Feldman <gena01@gmail.com>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=envconsul
pkgver=0.10.0
pkgrel=0
pkgdesc="Read and set environmental variables for processes from Consul."
url="https://www.consul.io/"
arch="all !mips !mips64" # missing GO
license="MPL-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/envconsul/archive/v$pkgver.tar.gz"

build() {
	export CGO_ENABLED="0"
	mkdir -p pkg/linux-$CARCH
	go build -v -o pkg/linux-$CARCH/$pkgname
}

check() {
	go test -timeout=30s -parallel=20 -failfast
}

package() {
	# Main binary
	install -m755 -D pkg/linux-$CARCH/$pkgname "$pkgdir"/usr/bin/$pkgname
}

sha512sums="0680215569ee5726b1018ec2ef8e06e4ddbee76a272d5dcdda8993470968743e30fc4509211474f076009a9340cca114325e61869e32f3d39725d3064f00d6a0  envconsul-0.10.0.tar.gz"
